package com.sumer.psychology.common.persistence.hibernate;

import com.sumer.psychology.common.spring.SpringHibernateSessionProvider;
import org.hibernate.Session;

/**
 * 基类资源库
 * <p/>
 * User: zhenguang.zhu
 * Date: 2014/8/14
 * Time: 13:49
 */
public abstract class AbstractHibernateRepository {
    private SpringHibernateSessionProvider sessionProvider;

    protected Session session() {
        return sessionProvider().session();
    }

    public SpringHibernateSessionProvider sessionProvider() {
        return sessionProvider;
    }

    public void setSessionProvider(SpringHibernateSessionProvider sessionProvider) {
        this.sessionProvider = sessionProvider;
    }
}
